package cc.facesign.admin.client;

import cc.facesign.common.utils.bean.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

@Component
@FeignClient(value = "service-oss")
public interface OssClient {

    @ApiOperation("上传图片到oss，返回图片url")
    @PostMapping(value = "/oss/pic/upload", consumes = "multipart/form-data")
    R upload(MultipartFile file);


    @ApiOperation("根据图片路径上传到阿里云，返回url")
    @GetMapping("/oss/pic/uploadByUrl")
    R uploadForUrl(@RequestParam(value = "url", defaultValue = "default") String url);

}
